CC=g++
LEXER=lexer.l
PARSER=parser.y
PROGRAM=parser.out
P=../model/
SRC:=Clazz.cpp Attribute.cpp Method.cpp XMLSerializable.cpp Parameter.cpp AccessModifier.cpp
SRC2:=$(addprefix $(P), $(SRC))

OBJS=$(SRC:.cpp=.o)
INCPATH=-I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -Igrammar -Imodel -I. -I. -I../model
LIBS=-L/usr/lib -lQtGui -lQtCore -lpthread -lfl

$(PROGRAM): $(PARSER) $(LEXER) $(OBJS) 
	#echo $(SRC2)
	bison -d $(PARSER) --verbose --debug
	flex $(LEXER)
	#$(CC) $(INCPATH) -pedantic -c util.c
	#$(CC) $(INCPATH) -pedantic -c $(SRC2)
	#echo $(OBJS)
	$(CC) $(INCPATH) -o $(PROGRAM) parser.tab.c $(OBJS) $(LIBS) 


%.o : $(P)%.cpp
	$(CC) -c $(INCPATH) -pedantic $<

%.o : %.cpp


clean:
	rm -f *.o
	rm -f parser.tab.h parser.tab.c lex.yy.c
	rm -f $(PROGRAM)

